package com.fanbo.springbootthymeleafblog.service;

import com.fanbo.springbootthymeleafblog.dao.TArticleMapper;
import com.fanbo.springbootthymeleafblog.entity.TArticle;
import com.fanbo.springbootthymeleafblog.entity.TArticleExample;
import com.github.pagehelper.PageHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author fanbo@imoran.net
 * @date 2021/1/17 22:39
 */
@Service
public class BlogService {

    @Autowired
    private TArticleMapper articleMapper;

    public List<TArticle> pageList() {
        TArticleExample tArticleExample = new TArticleExample();
        TArticleExample.Criteria criteria = tArticleExample.createCriteria();
        criteria.andTitleIsNotNull();
        List<TArticle> tArticles = articleMapper.selectByExample(tArticleExample);

        return tArticles;
    }
}
